
package dieci.hibernate;

import dieci.database.PersistentObject;
import dieci.system.*;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

/**
 *
 * @author DuckSys
 */
public class HibOrder implements PersistentObject{

    private Date orderDate;
    private long orderId;
    private Set<HibOrderDetails> details = new HashSet<>();
    private int supplierId;
    private double totalOrderAmount;

    public HibOrder()
    {
    }

    public HibOrder(Order order)
    {
        this.supplierId = order.getSupplier().getSupplierId();
        this.orderDate = order.getOrderDate();
        this.totalOrderAmount = order.getTotalOrderAmount();
    }
    
    public HibOrder(long orderId, Order order)
    {
        this(order);
        this.orderId = orderId;
    }
    
    
       /**
     * Get the value of totalOrderAmount
     *
     * @return the value of totalOrderAmount
     */
    public double getTotalOrderAmount()
    {
        return totalOrderAmount;
    }

    /**
     * Set the value of totalOrderAmount
     *
     * @param totalOrderAmount new value of totalOrderAmount
     */
    public void setTotalOrderAmount(double totalOrderAmount)
    {
        this.totalOrderAmount = totalOrderAmount;
    }

    
    /**
     * Get the value of supplierId
     *
     * @return the value of supplierId
     */
    public int getSupplierId()
    {
        return supplierId;
    }

    /**
     * Set the value of supplierId
     *
     * @param supplierId new value of supplierId
     */
    public void setSupplierId(int supplierId)
    {
        this.supplierId = supplierId;
    }

    

    
    
    /**
     * Get the value of details
     *
     * @return the value of details
     */
    public Set<HibOrderDetails> getDetails()
    {
        return details;
    }

    /**
     * Set the value of details
     *
     * @param details new value of details
     */
    public void setDetails(Set<HibOrderDetails> details)
    {
        this.details = details;
    }


    /**
     * Get the value of orderId
     *
     * @return the value of orderId
     */
    public long getOrderId()
    {
        return orderId;
    }

    /**
     * Set the value of orderId
     *
     * @param orderId new value of orderId
     */
    public void setOrderId(long orderId)
    {
        this.orderId = orderId;
    }

    /**
     * Get the value of orderDate
     *
     * @return the value of orderDate
     */
    public Date getOrderDate()
    {
        return orderDate;
    }

    /**
     * Set the value of orderDate
     *
     * @param orderDate new value of orderDate
     */
    public void setOrderDate(Date orderDate)
    {
        this.orderDate = orderDate;
    }

}
